#ifndef GWTEXT_H
#define GWTEXT_H

#include "property/qtvariantproperty.h"
#include "property/qttreepropertybrowser.h"
#include "fileeditfactory.h"
#include "GraphicsType.h"
#include "GwGraphics_global.h"
#include <QGraphicsItem>
#include <property/qttreepropertybrowser.h>
#include <QTimeLine>
#include <QObject>

class GWGRAPHICS_EXPORT GwText : public QGraphicsTextItem
{
    Q_OBJECT
public:
    explicit GwText();
    explicit GwText(const GwText &other);
    void setPropertyTree(QtTreePropertyBrowser *treepro);
    void refreshProperty(QtProperty *item);
    void refreshPropertyList();
    void createPropertyList();
    GwText & operator = (const GwText &other);
    friend QDataStream & operator >> (QDataStream &in,GwText& data);
    friend QDataStream & operator << (QDataStream &out,const GwText& data);
    void setConfig();

private:
    QList<QtProperty*> m_propertys;
    QtVariantPropertyManager *m_pVarManager=NULL;
    QtVariantEditorFactory *m_pVarFactory=NULL;
//    QFont font;

public slots:
    void propertyChanged(QtProperty *property, const QVariant &val);

    // QGraphicsItem interface
protected:
    void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event);
    void focusOutEvent(QFocusEvent *event);
    void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
};

#endif // GWTEXT_H
